<?php

namespace humhub\modules\api\models;

use Yii;

/**
 * @author petersmithca
 */
class Follow extends \humhub\modules\user\models\Follow
{
    //public function getUser()
    //{
    //    return $this->hasOne(User::className(), ['id' => 'user_id']);
    //}

    public function getFollow($user, $uid=""){
        //copy directorycontroller
        if ($user->isCurrentUser() || \Yii::$app->user->isGuest) {
            return '';
        }

        // Hide inactive button
        if ($user->isFollowedByUser($uid)) {
            return 'unfollow';
        } else {
            return 'follow';
        }
    }
}
